package com.ruihu.admin.module.business.task.domain.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.ruihu.admin.common.domain.BaseEntity;
import com.ruihu.admin.module.business.tasknode.domain.entity.TaskNodeEntity;
import lombok.Data;

/**
 * [ 任务环节实例表 ]
 *
 * @author Tony
 * @version 1.0
 * @company 瑞虎（南京）信息技术有限公司
 * @copyright (c)  瑞虎（南京）信息技术有限公司Inc. All rights reserved.
 * @date 2022-08-30 17:01:07
 * @since JDK1.8
 */
@Data
@TableName("t_task_node_inst")
public class TaskNodeInstEntity extends BaseEntity{


    /**
     * 任务环节ID
     */
    private Long taskNodeId;

    /**
     * 任务环节名称
     */
    private String taskNodeName;

    /**
     * 序号
     */
    private Integer sortNo;

    /**
     * 主任务ID
     */
    private Long mainTaskId;

    /**
     * 乐观锁
     */
    private Integer revision;

    /**
     * 创建人
     */
    private Long createBy;


    /**
     * 更新人
     */
    private Long updateBy;


    public static TaskNodeInstEntity convertToTaskNodeInstEntity(TaskNodeEntity taskNodeEntity) {
        TaskNodeInstEntity taskNodeInstEntity = new TaskNodeInstEntity();
        taskNodeInstEntity.setTaskNodeId(taskNodeEntity.getId());
        taskNodeInstEntity.setTaskNodeName(taskNodeEntity.getNodeName());
        taskNodeInstEntity.setSortNo(taskNodeEntity.getSortNo());
        return taskNodeInstEntity;
    }
}
